/**
 * 
 */
package com.cloudcast.client.presenter;

import com.cloudcast.client.controller.Controller;
import com.cloudcast.client.controller.Responsible;
import com.cloudcast.client.view.View;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.google.gwt.event.shared.HandlerManager;

/**
 * @author Samuel García Martínez <in0de>
 *
 */
public class SimplePresenter extends AbstractPresenter {	
	
	private View view;
	private String id;
	
	public SimplePresenter(Responsible parent, HandlerManager eventBus, View view, String id) {
		super(parent, eventBus);
		
		this.id = id;
		this.view = view;
	}

	/* (non-Javadoc)
	 * @see com.cloudcast.client.presenter.Presenter#getView()
	 */
	@Override
	public View getView() {
		return this.view;
	}

	/* (non-Javadoc)
	 * @see com.cloudcast.client.presenter.Presenter#go(com.extjs.gxt.ui.client.widget.LayoutContainer)
	 */
	@Override
	public void go(LayoutContainer container) {
		container.add(getView().asContainer());
		container.layout();
	}

	/* (non-Javadoc)
	 * @see com.cloudcast.client.controller.Responsible#bind(com.cloudcast.client.controller.Controller)
	 */
	@Override
	public void bind(Controller controller) {
	}

	/* (non-Javadoc)
	 * @see com.cloudcast.client.controller.Responsible#getId()
	 */
	@Override
	public String getId() {
		return this.id;
	}

	/* (non-Javadoc)
	 * @see com.cloudcast.client.controller.Responsible#unbind(com.cloudcast.client.controller.Controller)
	 */
	@Override
	public void unbind(Controller controller) {
	}

}
